package com.gtxc.kotlinmvvm.view;

import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.gtxc.kotlinmvvm.R;
import com.gtxc.kotlinmvvm.ui.activity.NodeActivity;




/**
 * FileName:Node
 * Author：Administrator
 * Date:2021 2021/9/28 17:57
 * Copyright (C), 2020-2021,成都拇音科技有限公司
 * <p>
 * <p>
 * Description: zwl
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
public class NodeRelativeLayout extends RelativeLayout {
    public final  ImageView iv02,iv03,iv04,iv05,ivc1a,ivc1b,ivc1c,ivc2a,ivc2b,ivc2c,ivc3a,ivc3b,ivc3c;
    public NodeRelativeLayout(Context context, AttributeSet attrs)  {
        super(context);
        View inflate = LayoutInflater.from(context).inflate(R.layout.node_relative_ayout, this, true);
        iv02= inflate.findViewById(R.id.iv_02);
        iv03  =inflate. findViewById(R.id.iv_03);
        iv04 =inflate. findViewById(R.id.iv_04);
        iv05  =inflate. findViewById(R.id.iv_05);
        ivc1a  =inflate. findViewById(R.id.iv_c1a);
        ivc1b  =inflate. findViewById(R.id.iv_c1b);
        ivc1c  =inflate. findViewById(R.id.iv_c1c);
        ivc2a = inflate.findViewById(R.id.iv_c2a);
        ivc2b =inflate. findViewById(R.id.iv_c2b);
        ivc2c =inflate. findViewById(R.id.iv_c2c);
        ivc3a  = inflate.findViewById(R.id.iv_c3a);
        ivc3b  = inflate.findViewById(R.id.iv_c3b);
        ivc3c =inflate. findViewById(R.id.iv_c3c);
    }


    @SuppressLint("UseCompatLoadingForDrawables")
    public void setViewBackground(int a){
        switch (a){
            case 1:
                iv02.setBackground(getResources().getDrawable(R.mipmap.a2));
                break;
            case 2:
                iv02.setBackground(getResources().getDrawable(R.mipmap.a2));
                break;
            case 3:
                iv02.setBackground(getResources().getDrawable(R.mipmap.a2));
                break;
            case 4:
                iv02.setBackground(getResources().getDrawable(R.mipmap.a2));
                break;
            case 5:
                iv02.setBackground(getResources().getDrawable(R.mipmap.c3));
                break;
            case 6:
                iv02.setBackground(getResources().getDrawable(R.mipmap.c3));
                break;
            case 7:
                iv02.setBackground(getResources().getDrawable(R.mipmap.c3));
                break;
            case 8:
                iv02.setBackground(getResources().getDrawable(R.mipmap.c3));
                break;
            case 9:
                iv02.setBackground(getResources().getDrawable(R.mipmap.c3));
                break;
            case 10:
                iv02.setBackground(getResources().getDrawable(R.mipmap.c3));
                break;
            case 11:
                iv02.setBackground(getResources().getDrawable(R.mipmap.c3));
                break;
            case 12:
                iv02.setBackground(getResources().getDrawable(R.mipmap.c3));
                break;
            case 13:
                iv02.setBackground(getResources().getDrawable(R.mipmap.c3));
                break;
        }
    }
}
